<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>My JSP 'password.jsp' starting page</title>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<script type="text/javascript">
	$(function() {
		$("#updateId").click(
				function() {
					var r = $('#userForm').form('validate');
					if(!r) {
						return false;
					}
					$.post("/ExaminationManagementSystem/user/editPwd", $(
							"#userForm").serializeArray(), function(data) {
						$.messager.alert('提示', data, 'info');
						if (data == '修改成功！') {
							$('#tt').tabs('close', '修改密码');
						}
					});
				});
		$("#backId").click(
				function() {
					$('#tt').tabs('close', '修改密码');
		});
	});
	
	$.extend($.fn.validatebox.defaults.rules, {
  		 	pwd: {
		        validator: function (value) {		        
		            return $("input[name=newPwd]").val()==value;
		        },
		        message: '两次输入的密码不一致.'
	    	}
	   });
	   $(function(){
			$('#userForm input').each(function () {
	            if ($(this).attr('required') || $(this).attr('validType'))
		                $(this).validatebox();
		    });	
	   });
</script>
<style type="text/css">
	#pwdId td {
		font-size: 13px;
	}
	input{
			width:200px;
			border:1px solid #ccc;
			padding:2px;
	}
</style>
</head>
<body>
	<center>
		<div>
			<form id="userForm" method="post"
				action="/ExaminationManagementSystem/user/editPwd">
				<table id="pwdId">
					<tr>
						<td colspan="2" align="center"><h2>密码修改</h2>
						</td>
					</tr>
					<tr>
						<td>原始密码：</td>
						<td><input type="password" required="true" missingMessage="原始密码不能为空"  name="pwd"  class="easyui-validatebox"/><span></span>
						</td>
					</tr>
					<tr>
						<td>新密码：</td>
						<td><input type="password" required="true" missingMessage="新密码不能为空"   class="easyui-validatebox"
							name="newPwd" /><span></span>
						</td>
					</tr>
					<tr>
						<td>确认密码：</td>
						<td><input type="password" validType="pwd" required="true" missingMessage="确认密码不能为空"   class="easyui-validatebox"
							name="newPwd2" /><span></span>
						</td>
					</tr>
					<tr height="10px">
						<td>
						</td>
						<td>
						</td>
					</tr>
				</table>
				<a id="backId" class="easyui-linkbutton"
							iconCls="icon-back">返回</a><span style="width: 26px"></span>
				<a id="updateId" class="easyui-linkbutton" iconCls="icon-edit">修改</a>
			</form>

		</div>
	</center>
</body>
</html>
